package org.stragma.symbian;

public class ArgumentManager {
	
	private String[] args;

	/**
	 * Default constructor for ArgumentManager
	 */
	public ArgumentManager(String[] args) {
		// Check object invariance
		if (args.length == 0) {
			throw new IllegalArgumentException("No arguments presented, error.");
		}
		this.args = args;
	}
	
	/**
	 * @return
	 * Depending on the first argument (which is all we plan to support for the moment) load the appropriate command
	 */
	public ICommand getCommand() {
		if (args[0].equalsIgnoreCase("-s")) {
			return new StatisticsCommand(args);
		} else if (args[0].equalsIgnoreCase("-p")) {
			return new PerformanceTestCommand(args);
		}
		return null;
	}
}